package util;

public class aStarNode implements Comparable {

	Integer _ZDDId;
	Integer _actCost;
	Integer _estCost = 0;
	aStarNode _ZDDParentId = null;
	
	
	public aStarNode (int ZDDId, int actCost, int estCost ) {
		_ZDDId = ZDDId;	
		_actCost = actCost;
		if (estCost >= 0) {
			_estCost = estCost;
		} else {
			_estCost = 0;
		}
	}
	
	public int getActCost() {
		return _actCost;
	}
	
	public int getEstCost() {
		return _estCost;
	}
	public int getZDDId() {
		return _ZDDId;
	}

	// Reserve Order
	@Override
	public int compareTo(Object o) {
		aStarNode oTmp = (aStarNode)o;
		if (_actCost + _estCost > oTmp._actCost + oTmp._estCost) {
			return -1;
		} else if (_actCost + _estCost < oTmp._actCost + oTmp._estCost) {
			return +1;
		} else {
			return 0;
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}

